package samples.chapter10;

// import org.apache.shiro.authz.annotation.Logical;
// import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

@Controller("/chapter10/shiro")
public class Chapter10ShiroController {
    @PostMapping("doLogin")
    public String doLogin() {
        return "login";
    }

    // @RequiresRoles("admin")
    @GetMapping("/admin")
    public String admin() {
        return "admin";
    }

    // @RequiresRoles(value = {"admin","user"}, logical = Logical.OR)
    @GetMapping("/user")
    public String user() {
        return "user";
    }
}
